<%- include('./layout/header.ejs') %>


  <h1>文章列表</h1>

  <div class="list-group" style="margin: 10px;">
    <% articles.forEach(item=>{ %>
      <a href="/article/info/<%= item.id %>" class="list-group-item">
        <%= item.title %>
        <span class="badge" style="background-color: #5bc0de;">发表时间：<%= item.ctime %></span>
        <span class="badge" style="background-color: #f0ad4e;">作者昵称：<%= item.nickname %></span>
      </a>
    <% })%>
      
      
     
      
  </div>

  <!-- 分页区域 -->
  <nav aria-label="Page navigation">
      <ul class="pagination">
        <li class="disabled">
          <span href="?page=1" aria-label="Previous">
            <span aria-hidden="true">&laquo;</span>
          </span>
        </li>
        <!-- 循环分页 -->
        <% for(var i=1; i<=totalpage; i++){ %>
          <li class="<%= nowpage==i?'active':''%>"><a href="?page=<%=i%>"><%=i%></a></li>
        <% } %>
        
        <li class="">
          <a href="?page=2" aria-label="Next">
            <span aria-hidden="true">&raquo;</span>
          </a>
        </li>
      </ul>
    </nav>



  <%- include('./layout/footer.ejs') %>